package com.hushao.lims.weblims.service;

import com.hushao.lims.weblims.domain.EquipmentInfo;
import com.hushao.lims.weblims.domain.EquipmentRepair;
import com.hushao.lims.weblims.domain.TeacherInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.math.BigDecimal;

/**
 * @author 930588706
 * @date 18/1/28
 * 报修
 */
public interface EquipmentRepairService {
    /**
     * 报修器材
     * @param equipmentInfo
     * @param equipmentCount
     * @return
     * @throws Exception
     */
    EquipmentRepair applyRepais(EquipmentInfo equipmentInfo, Integer equipmentCount, TeacherInfo teacherInfo)throws Exception;

    /**
     * 查看个人器材报修集合
     * @param equipmentName
     * @param teacher
     * @param pageable
     * @return
     */
    Page<EquipmentRepair> listEquipmentRepertoryByTeacherAndEquipmentName(String equipmentName, TeacherInfo teacher, Pageable pageable);

    /**
     * 撤销报修
     * @param repairsId
     * @throws Exception
     */
    void remove(int repairsId)throws Exception;

    /**
     * 根据器材名称，状态模糊查询报修
     * @param equipmentName
     * @param state
     * @param pageable
     * @return
     */

    Page<EquipmentRepair> listEquipmentRepairEquipmentNameLikeAndStateLike(String equipmentName, String state, Pageable pageable);

    /**
     * 审核器材报修
     * @param repairId
     * @param state
     * @param teacher
     * @return
     * @throws Exception
     */
    EquipmentRepair audit(int repairId, String state, TeacherInfo teacher)throws Exception;

    /**
     * 获取报修器材信息
     * @param repairId
     * @return
     */
    EquipmentRepair findOne(int repairId);
    /**
     * 完成器材报修
     * @param repairId
     * @param repairPrice
     * @return
     * @throws Exception
     */
    EquipmentRepair achieve(int repairId, BigDecimal repairPrice) throws Exception;
}
